gdk_drag_begin_for_device
gdk_drag_motion
gdk_drop_finish
-gdk_drag_get_protocol_for_display
GdkDragProtocol
GdkDragAction
gdk_drag_status
gdk_drag_drop_succeeded
+gdk_window_get_drag_protocol
gdk_drag_context_get_actions
gdk_drag_context_get_suggested_action
gdk_drag_drop
gdk_drag_drop_succeeded
gdk_drag_find_window_for_screen
-gdk_drag_get_protocol_for_display
gdk_drag_get_selection
gdk_drag_motion
gdk_drag_protocol_get_type G_GNUC_CONST
gdk_window_get_device_events
gdk_window_get_device_position
gdk_window_get_display
+gdk_window_get_drag_protocol
gdk_window_get_effective_parent
gdk_window_get_effective_toplevel
gdk_window_get_events
return GDK_DISPLAY_GET_CLASS(display)->get_app_launch_context (display);
}
-/**
- * gdk_drag_get_protocol_for_display:
- * @display: the #GdkDisplay where the destination window resides
- * @xid: the windowing system id of the destination window.
- * @protocol: (out): location where the supported DND protocol is returned.
- *
- * Finds out the DND protocol supported by a window.
- *
- * Return value: the windowing system id of the window where the drop
- * should happen. This may be @xid or the id of a proxy window,
- * or zero if @xid does not support Drag and Drop.
- *
- * Since: 2.2
- */
-GdkNativeWindow
-gdk_drag_get_protocol_for_display (GdkDisplay *display,
- GdkNativeWindow xid,
- GdkDragProtocol *protocol)
-{
- return GDK_DISPLAY_GET_CLASS (display)->get_drag_protocol (display, xid, protocol, NULL);
-}
-
/**
* gdk_display_open:
* @display_name: the name of the display to open
GList * (*list_devices) (GdkDisplay *display);
GdkAppLaunchContext * (*get_app_launch_context) (GdkDisplay *display);
- GdkNativeWindow (*get_drag_protocol) (GdkDisplay *display,
- GdkNativeWindow winid,
- GdkDragProtocol *protocol,
- guint *version);
void (*before_process_all_updates) (GdkDisplay *display);
void (*after_process_all_updates) (GdkDisplay *display);
GdkDevice *device,
GList *targets);
-GdkNativeWindow gdk_drag_get_protocol_for_display (GdkDisplay *display,
- GdkNativeWindow xid,
- GdkDragProtocol *protocol);
-
void gdk_drag_find_window_for_screen (GdkDragContext *context,
GdkWindow *drag_window,
GdkScreen *screen,
GDK_WINDOW_IMPL_GET_CLASS (window->impl)->register_dnd (window);
}
+/**
+ * gdk_window_get_drag_protocol:
+ * @window: the destination window
+ * @target: (out) (allow-none) (transfer full): location of the window
+ * where the drop should happen. This may be @window or a proxy window,
+ * or %NULL if @window does not support Drag and Drop.
+ *
+ * Finds out the DND protocol supported by a window.
+ *
+ * Returns: the supported DND protocol.
+ *
+ * Since: 3.0
+ */
+GdkDragProtocol
+gdk_window_get_drag_protocol (GdkWindow *window,
+ GdkWindow **target)
+{
+ g_return_val_if_fail (GDK_IS_WINDOW (window), GDK_DRAG_PROTO_NONE);
+
+ return GDK_WINDOW_IMPL_GET_CLASS (window->impl)->get_drag_protocol (window, target);
+}
+
/**
* gdk_drag_begin:
* @window: the source window for this drag.
gdouble opacity);
void gdk_window_register_dnd (GdkWindow *window);
+GdkDragProtocol
+ gdk_window_get_drag_protocol(GdkWindow *window,
+ GdkWindow **target);
+
void gdk_window_begin_resize_drag (GdkWindow *window,
GdkWindowEdge edge,
gint button,
void (* set_composited) (GdkWindow *window,
gboolean composited);
void (* destroy_notify) (GdkWindow *window);
+ GdkDragProtocol (* get_drag_protocol) (GdkWindow *window,
+ GdkWindow **target);
void (* register_dnd) (GdkWindow *window);
GdkDragContext * (*drag_begin) (GdkWindow *window,
GdkDevice *device,
gdk_x11_display_error_trap_pop_internal (display, FALSE);
}
-extern GdkAppLaunchContext *_gdk_x11_display_get_app_launch_context (GdkDisplay *display);
-extern GdkNativeWindow _gdk_x11_display_get_drag_protocol (GdkDisplay *display,
- GdkNativeWindow xid,
- GdkDragProtocol *protocol,
- guint *version);
-
-
/**
* gdk_x11_set_sm_client_id:
* @sm_client_id: the client id assigned by the session manager when the
display_class->supports_composite = gdk_x11_display_supports_composite;
display_class->list_devices = gdk_x11_display_list_devices;
display_class->get_app_launch_context = _gdk_x11_display_get_app_launch_context;
- display_class->get_drag_protocol = _gdk_x11_display_get_drag_protocol;
display_class->get_cursor_for_type = _gdk_x11_display_get_cursor_for_type;
display_class->get_cursor_for_name = _gdk_x11_display_get_cursor_for_name;
display_class->get_cursor_for_pixbuf = _gdk_x11_display_get_cursor_for_pixbuf;
void _gdk_x11_display_queue_events (GdkDisplay *display);
+GdkAppLaunchContext *_gdk_x11_display_get_app_launch_context (GdkDisplay *display);
+GdkNativeWindow _gdk_x11_display_get_drag_protocol (GdkDisplay *display,
+ GdkNativeWindow xid,
+ GdkDragProtocol *protocol,
+ guint *version);
+
gboolean _gdk_x11_display_set_selection_owner (GdkDisplay *display,
GdkWindow *owner,
GdkAtom selection,
g_object_unref (window);
}
+static GdkDragProtocol
+gdk_x11_window_get_drag_protocol (GdkWindow *window,
+ GdkWindow **target)
+{
+ GdkDragProtocol protocol;
+ GdkDisplay *display;
+ guint version;
+ Window xid;
+
+ display = gdk_window_get_display (window);
+ xid = _gdk_x11_display_get_drag_protocol (display,
+ GDK_WINDOW_XID (window->impl_window),
+ &protocol,
+ &version);
+
+ if (target)
+ {
+ if (xid != None)
+ *target = gdk_x11_window_foreign_new_for_display (display, xid);
+ else
+ *target = NULL;
+ }
+
+ return protocol;
+}
+
static void
update_wm_hints (GdkWindow *window,
gboolean force)
impl_class->set_opacity = gdk_x11_window_set_opacity;
impl_class->set_composited = gdk_x11_window_set_composited;
impl_class->destroy_notify = gdk_x11_window_destroy_notify;
+ impl_class->get_drag_protocol = gdk_x11_window_get_drag_protocol;
impl_class->register_dnd = _gdk_x11_window_register_dnd;
impl_class->drag_begin = _gdk_x11_window_drag_begin;
impl_class->process_updates_recurse = gdk_x11_window_process_updates_recurse;
private->need_map = private->is_mapped;
- if (gdk_drag_get_protocol_for_display (display, xid, &protocol))
+ protocol = gdk_window_get_drag_protocol (private->plug_window, NULL);
+ if (protocol)
gtk_drag_dest_set_proxy (GTK_WIDGET (socket), private->plug_window,
protocol, TRUE);
(xevent->xproperty.atom == gdk_x11_get_xatom_by_name_for_display (display, "_MOTIF_DRAG_RECEIVER_INFO")))
{
gdk_error_trap_push ();
- if (gdk_drag_get_protocol_for_display (display,
- xevent->xproperty.window,
- &protocol))
+ protocol = gdk_window_get_drag_protocol (private->plug_window, NULL);
+ if (protocol)
gtk_drag_dest_set_proxy (GTK_WIDGET (socket),
private->plug_window,
protocol, TRUE);